using UnityEngine;
// [Assembly-CSharp.dll].FireBaseCustomManager
public class FireBaseCustomManager : MonoBehaviour
{
    
    #region FireBaseCustomManager.<SignInFirebase>d__3
    // [Assembly-CSharp.dll].FireBaseCustomManager.<SignInFirebase>d__3
    private sealed class _SignInFirebase_d__3 : IEnumerator<object>, IEnumerator, IDisposable
    {
        // Fields
        private int __1__state;
        private object __2__current;
        public FireBaseCustomManager __4__this;
        
        // Properties
        private object System.Collections.Generic.IEnumerator<System.Object>.Current { get; }
        private object System.Collections.IEnumerator.Current { get; }
        
        // Methods
        public _SignInFirebase_d__3(int __1__state)
        {
            this.__1__state = __1__state;
        }
        private void System.IDisposable.Dispose()
        {
        
        }
        private bool MoveNext()
        {
            object val_3;
            int val_4;
            if(this.__1__state == 2)
            {
                goto label_1;
            }
            
            val_3 = 27358352;
            if(this.__1__state == 1)
            {
                goto label_2;
            }
            
            if(this.__1__state != 0)
            {
                    return false;
            }
            
            this.__1__state = 0;
            UnityEngine.WaitForSeconds val_1 = 536895821;
            val_3 = val_1;
            val_1 = new UnityEngine.WaitForSeconds(seconds:  5f);
            this.__2__current = val_3;
            val_4 = 1;
            goto label_8;
            label_2:
            this.__1__state = 0;
            this.__4__this.CheckForGooglePlayServices();
            UnityEngine.WaitForSeconds val_2 = 536895821;
            val_3 = val_2;
            val_2 = new UnityEngine.WaitForSeconds(seconds:  2f);
            this.__2__current = val_3;
            val_4 = 2;
            goto label_8;
            label_1:
            val_4 = 0;
            label_8:
            this.__1__state = val_4;
            return false;
        }
        private object System.Collections.Generic.IEnumerator<System.Object>.get_Current()
        {
            return (object)this.__2__current;
        }
        private void System.Collections.IEnumerator.Reset()
        {
            27351792 = new System.NotSupportedException();
            throw 27351792;
        }
        private object System.Collections.IEnumerator.get_Current()
        {
            return (object)this.__2__current;
        }
    
    }
    
    #endregion
    
    // Fields
    public Firebase.FirebaseApp FBapp;
    public static FireBaseCustomManager Instance;
    
    // Methods
    private void Start()
    {
        if((UnityEngine.Object.op_Implicit(exists:  mem[536886287])) != false)
        {
                if(mem[536886287] != this)
        {
                UnityEngine.Object.Destroy(obj:  this.gameObject);
        }
        
        }
        
        UnityEngine.Object.DontDestroyOnLoad(target:  this.gameObject);
        System.Collections.IEnumerator val_5 = this.SignInFirebase();
    }
    private System.Collections.IEnumerator SignInFirebase()
    {
        object val_1 = 536898681;
        val_1 = new System.Object();
        mem[536898697] = 0;
        mem[536898713] = this;
        return (System.Collections.IEnumerator)val_1;
    }
    private void CheckForGooglePlayServices()
    {
        System.Action<System.Object> val_2 = 536902199;
        val_2 = new System.Action<System.Object>(object:  this, method:  1610677521);
        System.Threading.Tasks.Task val_3 = Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(continuationAction:  val_2);
    }
    public void LogCustomEvent(string FBCusEvent)
    {
        if(UnityEngine.Application.internetReachability == 0)
        {
                return;
        }
        
        if(this.FBapp == null)
        {
                return;
        }
        
        Firebase.Analytics.FirebaseAnalytics.LogEvent(name:  FBCusEvent);
    }
    public FireBaseCustomManager()
    {
    
    }
    private void <CheckForGooglePlayServices>b__4_0(System.Threading.Tasks.Task<Firebase.DependencyStatus> task)
    {
        if(task.Result != 0)
        {
                return;
        }
        
        this.FBapp = Firebase.FirebaseApp.DefaultInstance;
        mem2[0] = this;
        this.LogCustomEvent(FBCusEvent:  -1610607423);
    }

}
